package com.nmtx.jfinal.config;

import com.jfinal.config.Constants;
import com.jfinal.config.Handlers;
import com.jfinal.config.Interceptors;
import com.jfinal.config.JFinalConfig;
import com.jfinal.config.Plugins;
import com.jfinal.config.Routes;
import com.jfinal.core.JFinal;
import com.jfinal.template.Engine;
import com.nmtx.doc.core.api.jfinal.JFinalApiDocConfig;
import com.nmtx.jfinal.controller.UserController;

public class MainConfig extends JFinalConfig {

    @Override
    public void configConstant(Constants me) {
        loadPropertyFile("jfinal.properties");
    }

    @Override
    public void configRoute(Routes me) {
        me.add("/user", UserController.class);
        if ("dev".equals(getProperty("mode"))) {
            new JFinalApiDocConfig("jdoc.properties").setClearSuffix("Controller").start();
        }
    }

    @Override
    public void configEngine(Engine me) {

    }

    @Override
    public void configPlugin(Plugins me) {
        // TODO Auto-generated method stub

    }

    @Override
    public void configInterceptor(Interceptors me) {
        // TODO Auto-generated method stub

    }

    @Override
    public void configHandler(Handlers me) {
        // TODO Auto-generated method stub

    }

    public static void main(String[] args) {
        JFinal.start("src/main/webapp", 8080, "/", 1200);
    }

}
